package com.yc.bean;

public class Good {
	private int gid;//商品编号
	private int tid;//类型id
	private String tname;//商品名称
	private int num;//购买的商品数量
	private String pic;//商品图片路径
	private double price;//商品价格
	private String color;//商品颜色
	private String version;//版本
	private String message;//详情
	private int inventory;//库存
	public int getGid() {
		return gid;
	}
	public void setGid(int gid) {
		this.gid = gid;
	}
	public int getTid() {
		return tid;
	}
	public void setTid(int tid) {
		this.tid = tid;
	}
	public String getTname() {
		return tname;
	}
	public void setTname(String tname) {
		this.tname = tname;
	}
	public int getNum() {
		return num;
	}
	public void setNum(int num) {
		this.num = num;
	}
	public String getPic() {
		return pic;
	}
	public void setPic(String pic) {
		this.pic = pic;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		this.price = price;
	}
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
	public String getVersion() {
		return version;
	}
	public void setVersion(String version) {
		this.version = version;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public int getInventory() {
		return inventory;
	}
	public void setInventory(int inventory) {
		this.inventory = inventory;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((color == null) ? 0 : color.hashCode());
		result = prime * result + gid;
		result = prime * result + inventory;
		result = prime * result + ((message == null) ? 0 : message.hashCode());
		result = prime * result + num;
		result = prime * result + ((pic == null) ? 0 : pic.hashCode());
		long temp;
		temp = Double.doubleToLongBits(price);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + tid;
		result = prime * result + ((tname == null) ? 0 : tname.hashCode());
		result = prime * result + ((version == null) ? 0 : version.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Good other = (Good) obj;
		if (color == null) {
			if (other.color != null)
				return false;
		} else if (!color.equals(other.color))
			return false;
		if (gid != other.gid)
			return false;
		if (inventory != other.inventory)
			return false;
		if (message == null) {
			if (other.message != null)
				return false;
		} else if (!message.equals(other.message))
			return false;
		if (num != other.num)
			return false;
		if (pic == null) {
			if (other.pic != null)
				return false;
		} else if (!pic.equals(other.pic))
			return false;
		if (Double.doubleToLongBits(price) != Double.doubleToLongBits(other.price))
			return false;
		if (tid != other.tid)
			return false;
		if (tname == null) {
			if (other.tname != null)
				return false;
		} else if (!tname.equals(other.tname))
			return false;
		if (version == null) {
			if (other.version != null)
				return false;
		} else if (!version.equals(other.version))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "Good [gid=" + gid + ", tid=" + tid + ", tname=" + tname + ", num=" + num + ", pic=" + pic + ", price="
				+ price + ", color=" + color + ", version=" + version + ", message=" + message + ", inventory="
				+ inventory + "]";
	}
	public Good(int gid, int tid, String tname, int num, String pic, double price, String color, String version,
			String message, int inventory) {
		super();
		this.gid = gid;
		this.tid = tid;
		this.tname = tname;
		this.num = num;
		this.pic = pic;
		this.price = price;
		this.color = color;
		this.version = version;
		this.message = message;
		this.inventory = inventory;
	}
	public Good() {
		super();
	}
	
}
